package com.sense.kukoo.biz_main.model

import com.sense.kukoo.common.mvvm.model.BaseMvvmModel
import com.sense.kukoo.common.repo.bean.ResultBean
import com.sense.kukoo.common.repo.http.KukooHttpApi
import com.sense.kukoo.common.repo.http.KukooHttpManager
import okhttp3.RequestBody

class MainModel: BaseMvvmModel() {

    private val TAG: String = javaClass.simpleName

    override fun onModelCleared() {}

    suspend fun registerPush(fcmToken: String): ResultBean<Boolean> {
        val hashMap = HashMap<String, Any>()
        hashMap.put("fcmToken", fcmToken)
        val mRequestBody: RequestBody = KukooHttpManager.createRequestBody(hashMap)

        return KukooHttpManager.instance
            .createHttpClient(KukooHttpApi::class.java)
            .registerPush(mRequestBody)
    }
}